# tk 没有原生支持toolbar，使用frame替代，但是感觉效果不好

from tkinter import *

root = Tk()

def callback():
    print('clicked tool bar button')

toobar = Frame(root)
b = Button(toobar, text='new', width=6, command=callback)
b.pack(side=LEFT, padx=2, pady=2)

c = Button(toobar, text='open', width=6, command=callback)
c.pack(side=LEFT, padx=2, pady=2)

toobar.pack(side=TOP, fill=X)
root.mainloop()